package com.harveyguo.nihonngo.exception;

/**
 * @Author：HarveyGuo
 * @Package：com.harveyguo.nihonngo.exception
 * @Project：BestReading_back
 * @name：ExceptionType
 *                     @Date：2023/2/16 16:52
 * @Filename：ExceptionType
 * @Describe：Do something
 */
public enum ExceptionType {

    OTHER_ERROR(500, "服务异常"),
    UNAUTHORIZED(401, "未登陆"),
    BAD_REQUEST(400, "请求错误"),
    FORBIDDEN(403, "无权限操作"),
    NOT_FOUND(404, "未找到路径"),
    USER_LOGIN_ERROR(40001000, "用户名或密码错误"),
    // 用户
    USER_NAME_DUPLICATE(40001001, "用户名已存在"),
    USER_NOT_FOUND(40001002, "用户不存在");

    private final Integer code;
    private final String message;

    ExceptionType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
